# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>

_gemname=maruku
pkgname=ruby-maruku
pkgver=0.7.3
pkgrel=6
pkgdesc='Pure-Ruby Markdown-superset interpreter'
url='https://github.com/bhollis/maruku'
arch=('any')
license=('MIT')
depends=('ruby')
makedepends=('ruby-rdoc')
options=('!emptydirs')
source=(${pkgname}-${pkgver}.tar.gz::https://github.com/bhollis/maruku/archive/v${pkgver}.tar.gz)
sha256sums=('d503927c2bc04075bbc57c04e5786d55ed872cb6f79ef76781086e142e69c125')
sha512sums=('a36da80ea1ed7f8909cc823e9222b17a65ca80589c7ad9a7fefbbb69ec97344207c168f78f49de15ac378dfae6ffe904b1a9bd1d52f67be5362d6658d24a0bfa')

prepare() {
  cd ${_gemname}-${pkgver}
  sed -r 's|~>|>=|g' -i ${_gemname}.gemspec # don't give a fuck about rubys bla bla
}

build() {
  cd ${_gemname}-${pkgver}
  gem build ${_gemname}.gemspec
}

package() {
  cd ${_gemname}-${pkgver}
  local _gemdir="$(gem env gemdir)"
  gem install --ignore-dependencies --no-user-install -i "${pkgdir}${_gemdir}" -n "${pkgdir}/usr/bin" ${_gemname}-${pkgver}.gem
  install -Dm 644 README.md CHANGELOG.md -t "${pkgdir}/usr/share/doc/${pkgname}"
  install -Dm 644 MIT-LICENSE.txt -t "${pkgdir}/usr/share/licenses/${pkgname}"
  rm "${pkgdir}/${_gemdir}/cache/${_gemname}-${pkgver}.gem"
}

# vim: ts=2 sw=2 et:
